package com.cr.business.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 合格证信息对象 tb_qualified_cert_info
 * 
 * @author tang
 * @date 2025-08-19
 */
public class TbQualifiedCertInfo implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 合格证ID */
    private String certId;

    /** 合格证编号 */
    private String certNo;

    /** 关联用户ID */
    private String userId;

    /** 主体信息ID */
    private String entityId;

    /** 关联产品ID */
    @NotNull(message = "产品不能为空！")
    private String productId;

    /** 产品名称 */
    private String productName;

    /** 关联生产人ID */
    @NotBlank(message = "生产人ID不能为空！")
    private String producerId;

    /** 生产人姓名 */
    private String producerName;

    /** 生产人电话 */
    private String producerPhone;

    /** 承诺依据，多个值以英文逗号隔开（1-质量安全控制符合要求，2-委托检测合格，3-自行检测合格） */
    @NotBlank(message = "承诺依据不能为空！")
    private String promise;

    /** 单张合格证重量 */
    @NotNull(message = "单张合格证重量不能为空！")
    @Min(value = 1, message = "单张合格证重量不能小于1！")
    private Long weight;

    /** 计量单位 */
    @NotBlank(message = "计量单位不能为空！")
    private String measurementUnit;

    /** 生产批次 */
    private String productBatch;

    /** 生产地址 */
    @NotBlank(message = "生产地址不能为空！")
    private String productAddr;

    /** 经度 */
    @NotBlank(message = "经度不能为空！")
    private String longitude;

    /** 纬度 */
    @NotBlank(message = "纬度不能为空！")
    private String latitude;

    /** 开具日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "开具日期不能为空！")
    private Date createTime;

    /** 打印张数 */
    private Long printQuantity;

    /** 删除标志（0-存在，2-删除） */
    private String delFlag;

    /** 采购信息 */
    private String purchaseInfo;

    public void setCertId(String certId)
    {
        this.certId = certId;
    }

    public String getCertId()
    {
        return certId;
    }

    public void setCertNo(String certNo) 
    {
        this.certNo = certNo;
    }

    public String getCertNo() 
    {
        return certNo;
    }

    public void setUserId(String userId) 
    {
        this.userId = userId;
    }

    public String getUserId() 
    {
        return userId;
    }

    public void setEntityId(String entityId) 
    {
        this.entityId = entityId;
    }

    public String getEntityId() 
    {
        return entityId;
    }

    public void setProductName(String productName) 
    {
        this.productName = productName;
    }

    public String getProductName() 
    {
        return productName;
    }

    public void setProducerName(String producerName) 
    {
        this.producerName = producerName;
    }

    public String getProducerName() 
    {
        return producerName;
    }

    public void setPromise(String promise) 
    {
        this.promise = promise;
    }

    public String getPromise() 
    {
        return promise;
    }

    public void setProducerPhone(String producerPhone) 
    {
        this.producerPhone = producerPhone;
    }

    public String getProducerPhone() 
    {
        return producerPhone;
    }

    public void setProducerId(String producerId) 
    {
        this.producerId = producerId;
    }

    public String getProducerId() 
    {
        return producerId;
    }

    public void setProductId(String productId) 
    {
        this.productId = productId;
    }

    public String getProductId() 
    {
        return productId;
    }

    public void setWeight(Long weight) 
    {
        this.weight = weight;
    }

    public Long getWeight() 
    {
        return weight;
    }

    public void setMeasurementUnit(String measurementUnit)
    {
        this.measurementUnit = measurementUnit;
    }

    public String getMeasurementUnit()
    {
        return measurementUnit;
    }

    public void setProductBatch(String productBatch) 
    {
        this.productBatch = productBatch;
    }

    public String getProductBatch() 
    {
        return productBatch;
    }

    public void setProductAddr(String productAddr) 
    {
        this.productAddr = productAddr;
    }

    public String getProductAddr() 
    {
        return productAddr;
    }

    public void setLongitude(String longitude) 
    {
        this.longitude = longitude;
    }

    public String getLongitude() 
    {
        return longitude;
    }

    public void setLatitude(String latitude) 
    {
        this.latitude = latitude;
    }

    public String getLatitude() 
    {
        return latitude;
    }

    public void setPrintQuantity(Long printQuantity) 
    {
        this.printQuantity = printQuantity;
    }

    public Long getPrintQuantity() 
    {
        return printQuantity;
    }

    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getPurchaseInfo() {
        return purchaseInfo;
    }

    public void setPurchaseInfo(String purchaseInfo) {
        this.purchaseInfo = purchaseInfo;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("certId", getCertId())
            .append("certNo", getCertNo())
            .append("userId", getUserId())
            .append("entityId", getEntityId())
            .append("productName", getProductName())
            .append("producerName", getProducerName())
            .append("promise", getPromise())
            .append("producerPhone", getProducerPhone())
            .append("producerId", getProducerId())
            .append("productId", getProductId())
            .append("weight", getWeight())
            .append("measurementUnit", getMeasurementUnit())
            .append("productBatch", getProductBatch())
            .append("productAddr", getProductAddr())
            .append("longitude", getLongitude())
            .append("latitude", getLatitude())
            .append("createTime", getCreateTime())
            .append("printQuantity", getPrintQuantity())
            .append("delFlag", getDelFlag())
            .append("purchaseInfo", getPurchaseInfo())
            .toString();
    }
}
